//package com.plian.system.controller.fr.internalauditmanagement;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.fr.internalauditmanagement.IamWorkSystemDTO;
//import com.plian.system.entity.fr.internalauditmanagement.IamWorkSystem;
//import com.plian.system.entity.fr.internalauditmanagement.IamWorkSystemDetail;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.fr.internalauditmanagement.IamWorkSystemService;
//import com.plian.system.vo.fr.internalauditmanagement.IamWorkSystemDetailVO;
//import com.plian.system.vo.fr.internalauditmanagement.IamWorkSystemVO;
//import com.plian.system.wrapper.fr.internalauditmanagement.IamWorkSystemWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * 内审工作制度
// *
// * @author jiatp
// * @since 2023-02-21
// */
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/nsgl/iam_work_system")
//@Api(value = "内审工作制度", tags = "内审工作制度")
//public class IamWorkSystemController extends BaseController {
//
//    private final IamWorkSystemService workSystemService;
//
//    private final IamWorkSystemWrapper workSystemWrapper;
//
//    /**
//     * 新增或修改
//     */
//    @ApiOperation(value = "新增或修改", notes = "新增或修改")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    public R submit(@Valid @RequestBody IamWorkSystemVO workSystemVO) {
//        return R.status(workSystemService.submit(workSystemVO));
//    }
//
//
//    /**
//     * 查询详情
//     */
//    @ApiOperation(value = "查询详情", notes = "查询详情")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/detail")
//    public R<IamWorkSystemDTO> detail(@RequestBody IamWorkSystem workSystem) throws Exception {
//        return R.data(workSystemService.detail(workSystem));
//    }
//
//
//    /**
//     * 列表分页
//     */
//    @ApiOperation(value = "列表分页", notes = "列表分页")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/list")
//    public ListResult<IamWorkSystemVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs() == null && query.getDescs() == null) {
//            query.setDescs("create_time");
//        }
//        QueryWrapper<IamWorkSystem> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new IamWorkSystem()), entityList
//        );
//        TokenSearch<IamWorkSystem> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//        IPage<IamWorkSystem> pages = workSystemService.page(Condition.getPage(query), queryWrapper);
//        ListResult<IamWorkSystemVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        //
//        List<IamWorkSystem> records = pages.getRecords();
//        List<IamWorkSystemVO> workSystemVOS = workSystemService.getAllSystems(workSystemWrapper.entityToVO(records));
//        listResult.setList(workSystemVOS);
//        listResult.setTotal(workSystemVOS.size());
//        return listResult;
//    }
//
//    /**
//     * 删除
//     */
//    @ApiOperation(value = "删除", notes = "删除")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @Transactional(rollbackFor = Throwable.class)
//    @PostMapping("/remove")
//    public R remove(@RequestBody IamWorkSystemDetailVO vo) {
//        List<Long> ids = vo.getIds();
//        return R.status(workSystemService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA))));
//    }
//
//    /**
//     * 内盛年度报告根据企业id查询制度
//     *
//     * @param workSystemVO
//     * @return
//     * @throws Exception
//     */
//    @ApiOperation(value = "根据企业id查询制度", notes = "根据企业id查询制度")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @Transactional(rollbackFor = Throwable.class)
//    @PostMapping("/findSystemDetailByEnterId")
//    public R<List<IamWorkSystemDetail>> findSystemDetailByEnterId(@RequestBody IamWorkSystemDetailVO workSystemVO) throws Exception {
//        return R.data(workSystemService.findSystemDetailByEnterId(workSystemVO));
//    }
//
//
//}
